<?php

class dashboardFormModel extends CFormModel {

    public function memberGrowthDaily() {
        $sql = "SELECT COUNT(*) AS member_count, DATE(member_join_datetime) AS member_join_date
            FROM sys_member 
            GROUP BY DATE(member_join_datetime)";
        $rs = Yii::app()->db->createCommand($sql)->queryAll();
        
        return $rs;
    }
    
    public function memberLog() {
        $sql = "SELECT COUNT(*) AS member_log_count, DATE(member_log_login_datetime) AS member_log_login_date
            FROM sys_member_log 
            GROUP BY DATE(member_log_login_datetime)";
        $rs = Yii::app()->db->createCommand($sql)->queryAll();
        
        return $rs;
    }

}